
/****** Object:  StoredProcedure [dbo].[sp_PIM_GetRecipeIngredientUserForListID]    Script Date: 12/17/2013 13:25:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter procedure [dbo].[sp_PIM_GetRecipeIngredientUserForListID]
@RecipeID nvarchar(200)
as
begin
	
	SELECT ISNULL(RI.RecipeIngredientUserID,-1)as RecipeIngredientUserID, RI.IngredientName,R.Serving,R.RecipeID,R.RecipeName
	FROM 
	RecipeIngredientUser RI right join RecipeUser R on R.RecipeID=RI.RecipeID
	
	where r.RecipeID in (select * from dbo.SplitRecipe(@RecipeID,','))
end
--[sp_PIM_GetRecipeIngredientUserForListID] '24,,22'

--select * from RecipeIngredientUser
--select * from dbo.SplitRecipe('2,3',',')